package com.guandata.cdc.model;

import lombok.Getter;

import java.util.Arrays;

@Getter
public enum DataTableType {
    MYSQL("mysql"), POSTGRES("postgres"), GAUSS("gauss");

    private final String code;

    DataTableType(String code) {
        this.code = code;
    }

    public static DataTableType from(String tableType) {
        return Arrays.stream(values())
                .filter(x -> x.code.equalsIgnoreCase(tableType))
                .findFirst()
                .orElse(null);
    }
}
